package com.neuedu.service.user.controller;

import com.neuedu.charge.base.entity.User;
import com.neuedu.charge.base.response.Result;
import com.neuedu.service.user.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user")
@Slf4j
public class UserController {
    @Autowired
    private UserService userService;

    @GetMapping("/get/users")
    public Result getUsers(){
        return Result.success(userService.list());
    }

    @GetMapping("/get/user/{id}")
    public Result getUserById(@PathVariable("id") Long id ){
        return Result.success(userService.getById(id));
    }

}
